UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KIevgb3R8/EtzJ6nFMxh1ONN5BHYDaG9yoha7EJZtAs=' 
WHERE 
  key_id = '36016e8480de5d972084ba39d8037936ea11a395a2ec2a7b889f19e5410cdb7c' 
  AND (
    token = 'KIevgb3R8/EtzJ6nFMxh1ONN5BHYDaG9yoha7EJZtAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026