UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OSwpGn/GPQseJyovKDDaqYk0ze7Dn85iGjEZhLBuTfs='
WHERE
key_id = 'b9eb557e50ed81f8c94e9ddf51c9fa82e4f0cbcf26cc050495213a73e336a29c'
AND (
token = 'OSwpGn/GPQseJyovKDDaqYk0ze7Dn85iGjEZhLBuTfs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)