UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uqno+eyzJTpPBXW0xXh7n9/uZzLxfkZHz5G4ls5ocdE='
WHERE
key_id = 'cd2d2957d050b0f865759a2aa566d11930772b3fe498466e1222c5b43c106915'
AND (
token = 'uqno+eyzJTpPBXW0xXh7n9/uZzLxfkZHz5G4ls5ocdE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)