UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0pq7VATUYZJbp4Yzxkjv9RBDvWcX93ixqrwnlwNXajQ=' 
WHERE 
  key_id = '98320df0a52f2783806ed97c12f3fa6dab3200458823dba65fe40a156240659b' 
  AND (
    token = '0pq7VATUYZJbp4Yzxkjv9RBDvWcX93ixqrwnlwNXajQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057