UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V24AKBCnuZkZe4gqXP6OucGBxPS6Waw4LR3Hrx1Lu5Q='
WHERE
key_id = '1911739e188b917d2a26849cf31329dda7189e39cf5e1317deb08c9c1d27308d'
AND (
token = 'V24AKBCnuZkZe4gqXP6OucGBxPS6Waw4LR3Hrx1Lu5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)