UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wVAIpbruxd3icpsNQFL8NCa8027dpOKu2g8r8OAc6b0='
WHERE
key_id = '8fee88fb12bab9519ab83f4a05573d123d87a600abf606de65604aa8dc9093c2'
AND (
token = 'wVAIpbruxd3icpsNQFL8NCa8027dpOKu2g8r8OAc6b0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)