UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z+C2UN/fiKeqEU0680lVV6cYMXDHvhldpdansRx/56I='
WHERE
key_id = 'aecd4cc300fddf07ed2960ba4db4d750611d97e2754625efc15925c7d3aafceb'
AND (
token = 'z+C2UN/fiKeqEU0680lVV6cYMXDHvhldpdansRx/56I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)