UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0DH+cnBEj/sNES0NE8L0gWo5grzOsFD3l2bLqVIycXw=' 
WHERE 
  key_id = '74be2aaeee2cd34cb9f6b633b5ea4eea8d4c100d278cebf6dc50ef5d8b2233ac' 
  AND (
    token = '0DH+cnBEj/sNES0NE8L0gWo5grzOsFD3l2bLqVIycXw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027