UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wl9czaksoUpsajB4E2Cs40D8eJ7KxEGW4k6WjB6pMnw=' 
WHERE 
  key_id = '7fd75bac1efd61e0abf6caf655f44cb0a853fdc8ee049dc0d99f4155a35570c4' 
  AND (
    token = 'wl9czaksoUpsajB4E2Cs40D8eJ7KxEGW4k6WjB6pMnw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033