UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FERU0ujJPwCAA7heVEpg7WU5bBrXXWlCxxHZ0UflQzo=' 
WHERE 
  key_id = '349665ddfb90552e8c29fae1960cb5f0663cd31c3f29269194e63bca8273f35f' 
  AND (
    token = 'FERU0ujJPwCAA7heVEpg7WU5bBrXXWlCxxHZ0UflQzo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033