UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IMxqwkjfc8IPqbq3CLqocjf2Wo1TF8DdycrCpWu6Vr0='
WHERE
key_id = '1cf9049db30d1cc480ba13671f5b6e705b1f6e23346a30305c5f14a6d8ed0b67'
AND (
token = 'IMxqwkjfc8IPqbq3CLqocjf2Wo1TF8DdycrCpWu6Vr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)