UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6yqK5w0R8Gh55VcghKQYFCZTfDOycEfHSJLlRsJrJno='
WHERE
key_id = '7418e36fc6a7f13b5c5b060a25cb0fc8a27b7a3d1b91c4cad6da7b5610c4b5e5'
AND (
token = '6yqK5w0R8Gh55VcghKQYFCZTfDOycEfHSJLlRsJrJno='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)