UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wnZUKQeMiXYmE1b/UOS1W+tOFCtNPnZgL6GuMvZXMBw=' 
WHERE 
  key_id = '72a1ec13b765b0aae62c01f22dffa9775bcea8d90d74bce86f146c5d474eb9c5' 
  AND (
    token = 'wnZUKQeMiXYmE1b/UOS1W+tOFCtNPnZgL6GuMvZXMBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045