UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5i42y5IEaP/sdftnIme15nnOKT4gbyK60ho8iSst/s8=' 
WHERE 
  key_id = 'efe01618c4f03180d90c139195d0889bef8a1f42c0893cab1dab2f0bbcdafc96' 
  AND (
    token = '5i42y5IEaP/sdftnIme15nnOKT4gbyK60ho8iSst/s8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029