UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hIJp6eepz7kzoHWzhiNz7hvnxSui3Ha53tB407FvG0Q=' 
WHERE 
  key_id = '08bbd72b76d543ddc87c0c03e6009aed53e3a07dbc486bbe91d93d798ef9ccee' 
  AND (
    token = 'hIJp6eepz7kzoHWzhiNz7hvnxSui3Ha53tB407FvG0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047