UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LJxVMwSKbVXYym7/jWXPziO5teASrU/EpiSsxLudjRA=' 
WHERE 
  key_id = '9eb96f597f0b3243bab15fecc37d209344eabcb24a18a4774b9f95d40102cda4' 
  AND (
    token = 'LJxVMwSKbVXYym7/jWXPziO5teASrU/EpiSsxLudjRA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028