UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A+ML6InqNw6pty7MJmZ0r7N5nc/fl/wbKn023cMi1ms=' 
WHERE 
  key_id = '5c2074a91ae78b2068374641f8ddbd3f7bcf056cad76f3250c30339c003ae5db' 
  AND (
    token = 'A+ML6InqNw6pty7MJmZ0r7N5nc/fl/wbKn023cMi1ms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043