UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8zpdN+qiZqqdZL5XMAycAHZaYSZn+mxlmiPgnMy3n8E='
WHERE
key_id = '69b0a11e98debe2da8c522207b59516268e7267200cd8b4b20015f4fa039f78c'
AND (
token = '8zpdN+qiZqqdZL5XMAycAHZaYSZn+mxlmiPgnMy3n8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)