UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uvw1c6AdOm0OK9V44gnkE+qPcgVoas9ON45jUMr6UnA='
WHERE
key_id = 'dc1af516ce3df82503add2ee8067864f170fd9c14ebf2a026774c4ab777f112c'
AND (
token = 'Uvw1c6AdOm0OK9V44gnkE+qPcgVoas9ON45jUMr6UnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)