UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XKsQ6YffLVwyU6yZeVB9uqjOMK5HYDEiSo5S2LuJCsw='
WHERE
key_id = 'e100f3998cbaf42c356c531f5dda719154bf43dd0dedcab76f37e65db05893c6'
AND (
token = 'XKsQ6YffLVwyU6yZeVB9uqjOMK5HYDEiSo5S2LuJCsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)