UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'krLbqkte6dSarMQVm53UNiSjnt3TUVNBNGyuwuo4+lc='
WHERE
key_id = '2fa05ce327665644fa6fea129109f23f055c4936cce7a9ccee698128a14c503c'
AND (
token = 'krLbqkte6dSarMQVm53UNiSjnt3TUVNBNGyuwuo4+lc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)