UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hhhscrDGLUnMoOF2qqIv0GhewqTNosE9Iza90qI4saM='
WHERE
key_id = '0f0348283ccc47dfbf674282248bec3d5acae01dbce1b3ebf2a2d97ed5ea93f1'
AND (
token = 'hhhscrDGLUnMoOF2qqIv0GhewqTNosE9Iza90qI4saM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)