UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yJor6XlVZpo43/4k7TiNjInWNOoO8Xx5Mz2x6QF6axE=' 
WHERE 
  key_id = '6a4fcc1f713c693c131f2bebcbaf9e1bbbeaad22f691095500a0d2d98eac2460' 
  AND (
    token = 'yJor6XlVZpo43/4k7TiNjInWNOoO8Xx5Mz2x6QF6axE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056