UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a/CAmkYN0PpOrM1kBASZkf4/Naf+GnHb20/jJfsCgyg='
WHERE
key_id = '95053408c90fff4130575f8522d39829f05239dee3569d33442bfc8796e3bce7'
AND (
token = 'a/CAmkYN0PpOrM1kBASZkf4/Naf+GnHb20/jJfsCgyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)