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