UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DgeYWGfuCnF4OA60y83eAyAf0taD3U3SQ9xLqup4ObY=' 
WHERE 
  key_id = '1a1fd9570ee6d280307374c0c04306b2a0fcb152e1b9a3420e2cbcc00241a81c' 
  AND (
    token = 'DgeYWGfuCnF4OA60y83eAyAf0taD3U3SQ9xLqup4ObY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031