UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+38zy6RUZZATKwXqKgRs8MW/ai0uM+pJh1tlVMa7Ebo='
WHERE
key_id = '5ab011dd2915c0741292c07a7ac47998dc53a3c994248c86128130876b24ac5e'
AND (
token = '+38zy6RUZZATKwXqKgRs8MW/ai0uM+pJh1tlVMa7Ebo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)