UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K3A00k0lg43s2B1s7XgP2Qrpg7QTyB1Ud1lxRUzM4rw='
WHERE
key_id = 'c2d8418b305c5c1a0bad4ee6af26d1151b3ad75c7c5dc98d59778bc1b5a796af'
AND (
token = 'K3A00k0lg43s2B1s7XgP2Qrpg7QTyB1Ud1lxRUzM4rw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)