UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/SWohF3saqUb9yCWq0CuUC7vrZ3FCYlLGjJAcj+QJlw=' 
WHERE 
  key_id = 'af1a688788a10f3cc3f500761428163de5faa9f1388af2a4a7ddc6293900581a' 
  AND (
    token = '/SWohF3saqUb9yCWq0CuUC7vrZ3FCYlLGjJAcj+QJlw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014