UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q325B7Muxpbfuvqjrs/T43178RZepxUAtxk5N3bdLos=' 
WHERE 
  key_id = 'caa35feb440edab7aa7dcc1cc57fcd0ecde1f04ee7571f3c290c211a241ee43c' 
  AND (
    token = 'Q325B7Muxpbfuvqjrs/T43178RZepxUAtxk5N3bdLos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031