UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '038HnoUCeDa1u5aN4wJZwaO7Q0Y25jEiaIgvPb85fOs='
WHERE
key_id = '9f6f2c778ecf54baaee6b439e4d5886d5254bcac8ab530a2025825ead6633575'
AND (
token = '038HnoUCeDa1u5aN4wJZwaO7Q0Y25jEiaIgvPb85fOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)