UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UWtcV+GjpIXrVpPYgnfPWgCeUx+1GjzioLoo35N5Mnw=' 
WHERE 
  key_id = '70ccdd0f17d34639efecf51c456a981f8c7099faa0d68a4428c6e872776ef578' 
  AND (
    token = 'UWtcV+GjpIXrVpPYgnfPWgCeUx+1GjzioLoo35N5Mnw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035