UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'na/q+L3u7RKWtULSH+FK3XvtIL5ilh6CU97TBQbT4Pg='
WHERE
key_id = 'bc8cea5d64ecd7228fd144abcfec8723c276b2e7d4102a676e27891ba8b0f011'
AND (
token = 'na/q+L3u7RKWtULSH+FK3XvtIL5ilh6CU97TBQbT4Pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)