UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZMxrMd60kat4UKPo3ZtFtWIb5Oe2JjO/P697X10QFDM=' 
WHERE 
  key_id = '5ff04e019d6505ff9f89032a38be1092031f72d56c36c3d0dc3676425cec1c80' 
  AND (
    token = 'ZMxrMd60kat4UKPo3ZtFtWIb5Oe2JjO/P697X10QFDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073