UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4jPXA+A2eizyuU7txQe613DmHTXScLtGfyZFiKgssa4='
WHERE
key_id = 'ed4fe945b862d9d252e13b94f81e8fd1a61f2deb686d1e48c70e27863bcb3a39'
AND (
token = '4jPXA+A2eizyuU7txQe613DmHTXScLtGfyZFiKgssa4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)