UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kRAsAYbc9uYsiOoI3IoHVUHX/Ky6KcNVO9Jcn+jxf6M='
WHERE
key_id = '8e1a7fa00654a48585af56af138b1324ab7350d14cabdb9b6b728e4f3fe6c2e0'
AND (
token = 'kRAsAYbc9uYsiOoI3IoHVUHX/Ky6KcNVO9Jcn+jxf6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)