UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BzphGuA6IppPUtxxySK6NPoTFF62guU4Ewagc8BRStk='
WHERE
key_id = '07efdfe5b9346941693b1761100fa2a0627769e300b5c14523d622be6c1563c4'
AND (
token = 'BzphGuA6IppPUtxxySK6NPoTFF62guU4Ewagc8BRStk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)