UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n2TkLXwQwmptYEn27qQgaeP0yq1bzTTY4NUl2pJkUlA=' 
WHERE 
  key_id = '93a8c6005852f76c2d0e757d71e8060d20e5249d80c0f000f15311474421f4ad' 
  AND (
    token = 'n2TkLXwQwmptYEn27qQgaeP0yq1bzTTY4NUl2pJkUlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024