UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ucbCM0pa/MC05fUe06IzqdDLcslItfhkoTQpfv1jOhE='
WHERE
key_id = 'f39a53a0cc00ecddf532f779fcd8d902e0b2d2e96ae644478dd89640e7f4cf6d'
AND (
token = 'ucbCM0pa/MC05fUe06IzqdDLcslItfhkoTQpfv1jOhE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)