UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ujjxQEY/TG94HvS1sO52qb4Fvd+8Qt2BR6cjqCIqu3U='
WHERE
key_id = '8148ae84a0fff87f5d6698c1e7fea4b43442b71297755e6f335469782a1ece16'
AND (
token = 'ujjxQEY/TG94HvS1sO52qb4Fvd+8Qt2BR6cjqCIqu3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)