UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KFhQF9qP2GjEMcfK2nxKQHg3oZQFm/BOnPLQrRx0Zs8='
WHERE
key_id = '683399891e4e108599bd3915c783be611db94615fbef466f99d70db9c4961966'
AND (
token = 'KFhQF9qP2GjEMcfK2nxKQHg3oZQFm/BOnPLQrRx0Zs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)